package com.weixin.xplore.dao.service.impl;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.func.LambdaUtil;
import cn.hutool.core.util.ClassUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import com.weixin.xplore.dao.common.BaseRepository;
import com.weixin.xplore.dao.entity.SysSetting;
import com.weixin.xplore.dao.service.SysSettingDaoService;
import com.weixin.xplore.utils.BeanUtil;
import lombok.RequiredArgsConstructor;
import org.anyline.data.param.ConfigStore;
import org.anyline.data.param.init.DefaultConfigStore;
import org.springframework.stereotype.Service;

import static org.springframework.data.jpa.domain.AbstractPersistable_.id;


@Service
@RequiredArgsConstructor
public class SysSettingDaoServiceImpl extends BaseRepository<SysSetting> implements SysSettingDaoService {
    @Override
    public SysSetting queryByKey(String key) {
        ConfigStore configStore = new DefaultConfigStore();
        configStore.eq(super.getFieldName(SysSetting::getSettingKey), key);
        SysSetting sysSetting = super.selectOne(configStore);

        return sysSetting;
    }


    public static void main(String[] args) {

        Class<?> typeArgument = ClassUtil.getTypeArgument(SysSettingDaoServiceImpl.class);
        System.out.println(typeArgument);
    }
}
